package datastructure.blockingqueue;

/**
 * 阻塞队列接口
 *
 * @author 杨 强
 * @package datastructure.blockingqueue
 * @createTime 2023-03-18 22:18
 */
public interface BlockingQueue<E> {

    /**
     * 入队
     * @param e
     * @throws InterruptedException
     */
    void offer(E e) throws InterruptedException;

    /**
     * 入队+最多阻塞时间
     * @param e
     * @param timeout
     * @return
     * @throws InterruptedException
     */
    void offer(E e, Long timeout) throws InterruptedException;

    /**
     * 出队
     * @return
     * @throws InterruptedException
     */
    E poll()throws InterruptedException;
}
